﻿CREATE TABLE [dbo].[Zzjg] (
    [id]        INT            IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [pid]       INT            NULL,
    [name]      NVARCHAR (200) NULL,
    [level]     INT            NULL,
    [sort]      VARCHAR (50)   CONSTRAINT [DF_Zzjg_sort] DEFAULT ((0)) NULL,
    [bh]        VARCHAR (50)   NULL,
    [flag]      INT            NULL,
    [CompanyId] INT            CONSTRAINT [DF_Zzjg_CompanyId] DEFAULT ((0)) NULL,
    CONSTRAINT [PK_Zzjg] PRIMARY KEY CLUSTERED ([id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'上一级ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'pid';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'name';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'级别。0为根结点', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'level';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'排序', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'sort';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'编号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'bh';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'0:非单位。1：单位(单位不能再建下级) ', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'flag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'关联单位ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Zzjg', @level2type = N'COLUMN', @level2name = N'CompanyId';

